import 'package:color_dart/RgbaColor.dart';
import 'package:flutter/cupertino.dart';
import 'package:im_flutter_sdk_example/provider/group_formdate_model.dart';
import 'package:im_flutter_sdk_example/utils/global.dart';
import 'package:provider/provider.dart';

class Head extends StatelessWidget {
  const Head({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    GroupFormDataModel _formData = Provider.of<GroupFormDataModel>(context);
    return Container(
      color: rgba(255, 255, 255, 1),
      child: Column(
        children: [
          Image.network(
            'https://static.kuaimayoupin.com/7173382932132624.jpg',
            fit: BoxFit.cover,
          ),
          Container(
            decoration: BoxDecoration(
              shape: BoxShape.rectangle,
              borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(13), topRight: Radius.circular(13)),
            ),
            padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Container(
                      width: 83,
                      height: 83,
                      decoration: BoxDecoration(
                          shape: BoxShape.rectangle,
                          color: rgba(255, 255, 255, 1),
                          borderRadius: BorderRadius.all(Radius.circular(11)),
                          boxShadow: [
                            BoxShadow(
                                color: rgba(0, 0, 0, 0.05),
                                offset: Offset(0.0, 4.0), //阴影xy轴偏移量
                                blurRadius: 8, //阴影模糊程度
                                spreadRadius: 1.0 //阴影扩散程度
                                )
                          ]),
                      child: SizedBox(
                        width: 83,
                        height: 83,
                        child: Image.network(
                          _formData.myGroup.logo,
                          fit: BoxFit.cover,
                        ),
                      ),
                    ),
                    Container(
                      width: 79,
                      height: 26,
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(3)),
                        border: Border.all(
                          color: rgba(42, 125, 250, 1),
                          width: 2,
                        ),
                      ),
                      child: GestureDetector(
                        onTap: () => {G.pushNamed('/alliance_manger')},
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Text('小组管理',
                                style: TextStyle(
                                    fontSize: 13, color: rgba(42, 125, 250, 1)))
                          ],
                        ),
                      ),
                    )
                  ],
                )
              ],
            ),
          ),
          Container(
            margin: EdgeInsets.only(left: 20, right: 20),
            child: Row(
              children: [
                Text(
                  _formData.myGroup.name,
                  style: TextStyle(fontSize: 22, fontWeight: FontWeight.w600),
                ),
              ],
            ),
          ),
          Container(
            margin: EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 10),
            height: 56,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.all(Radius.circular(5)),
              color: rgba(247, 249, 252, 1),
            ),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Container(
                  child: Row(
                    children: [
                      Text('小组',
                          style: TextStyle(
                              fontSize: 14, fontWeight: FontWeight.w600)),
                      Text('通知',
                          style: TextStyle(
                              fontSize: 14,
                              fontWeight: FontWeight.w600,
                              color: rgba(25, 109, 236, 1)))
                    ],
                  ),
                  padding: EdgeInsets.only(left: 19),
                ),
                Container(
                  child: Text(_formData.myGroup.note,
                      style: TextStyle(
                          fontSize: 13,
                          fontWeight: FontWeight.w600,
                          color: rgba(143, 155, 179, 1))),
                  padding: EdgeInsets.only(right: 19),
                ),
              ],
            ),
          ),
          Container(
            padding: EdgeInsets.only(left: 20, right: 20, bottom: 20),
            child: Row(
              children: [
                Container(
                  padding: EdgeInsets.only(right: 5),
                  child: SizedBox(
                    width: 23,
                    height: 23,
                    child: Image.asset(
                      'lib/assets/images/default_avatar.png',
                      fit: BoxFit.cover,
                    ),
                  ),
                ),
                Container(
                  padding: EdgeInsets.only(right: 5),
                  child: SizedBox(
                    width: 23,
                    height: 23,
                    child: Image.asset(
                      'lib/assets/images/default_avatar.png',
                      fit: BoxFit.cover,
                    ),
                  ),
                ),
                Text('共200个组员',
                    style:
                        TextStyle(fontSize: 12, color: rgba(107, 107, 107, 1)))
              ],
            ),
          )
        ],
      ),
    );
  }
}
